package com.five.wisdomClass.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.five.wisdomClass.entity.LeaveCount;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface LeaveMapper extends BaseMapper<LeaveCount> {
    // 查询当日的两种请假类型的人数
    @Select("SELECT leave_type, COUNT(*) AS leave_count FROM smartcampus.leave WHERE DATE(start_time) = CURRENT_DATE() AND state = 1 GROUP BY leave_type")
    List<LeaveCount> getLeaveCountByType();
}
